﻿@model IEnumerable<Subfaculty.WebApplication.ViewModels.DisciplineViewModel>

	@{
		ViewBag.Title = "Содержимое";
		Layout = "~/Views/Shared/_LayoutAllocation.cshtml";
	}

@*	<fieldset class="main_fieldset">
			<legend class="main_legend">@ViewBag.Message</legend>*@
			
			@{
				Html.Telerik().Grid(Model)
					.Name("GridDiscipline")
					.ToolBar(commands => commands.Insert().ButtonType(GridButtonType.ImageAndText).ImageHtmlAttributes(new {style = "margin-left:0"}))
					.DataKeys(keys => keys.Add(c => c.Id))
					.Columns(columns =>
				         		{
									columns.Bound(o => o.Title);
									//columns.Bound(o => o.Duration).HtmlAttributes(new { @class = "RightAlign" });
									columns.Command(commands =>
								                		{
															commands.Edit().ButtonType(GridButtonType.BareImage);
															commands.Delete().ButtonType(GridButtonType.BareImage);
														}).Width(180).Title("Commands");
								}
					)
					.DataBinding(dataBinding =>
				             		{
										dataBinding.Server().Select("Index", "Discipline", new { ajax = true });
										dataBinding.Ajax().Select("_Index", "Discipline").Enabled(true);
										dataBinding.Ajax()
											.Select("_SelectAjaxEditing", "Discipline")
											.Insert("_InsertAjaxEditing", "Discipline")
											.Update("_SaveAjaxEditing", "Discipline")
											.Delete("_DeleteAjaxEditing", "Discipline");
									})
					.Editable(editing => editing.Mode(GridEditMode.PopUp))
					.Scrollable(scrolling => scrolling.Enabled(true))
					.Scrollable(scrolling => scrolling.Height("600px"))
					.Sortable(sorting => sorting.Enabled(true))
					.Pageable(paging => paging.Enabled(true))
					.Filterable(filtering => filtering.Enabled(true))
					.Selectable(s => s.Enabled(true))
					.Groupable(grouping => grouping.Enabled(true))
					.Footer(true)
					.Render();
			}
@*	</fieldset>*@

@*<style type="text/css">
  .RightAlign
  {
    text-align: right;
    background-color: rgba(85,1,169,.6);
  }
</style>*@